<?php require_once "../interface/Interface.php"?>

<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>响应式表格</title>
		<link rel="stylesheet" href="show.css" />
	</head>
	<body>

        <?php
            $stuName = $_POST["stuName"];
            echo($stuName);
        ?>

		<div class="container">
			<?php
            
                //表格对象
                $table = new SimpleTable();

                //模拟树莓派发过来的post数据
                $rPi_Post_Data = "1,小明,2021.10.10_9:48;2,小红,2021.10.10_9:49;3,小光,2021.10.10_9:50";

                //处理表单数据
                $dataHandler = new RawData($rPi_Post_Data);

                //更新表格数据
                $tableObj = new SimpleTable();
                
                for($i = 0; $i < $dataHandler->countStudents(); $i++) {

                    $tableObj->pushLine($dataHandler->stuInfo[$i]);
                }

                echo($tableObj->generateTable());

                

            ?>
		</div>
	</body>
</html>
